package engine;

import java.io.File;
import java.util.UUID;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;

import org.junit.Ignore;
import org.junit.Test;

import engine.dataobjects.MailItem;
import engine.dataobjects.xml.Active;
import engine.dataobjects.xml.Inactive;
import engine.dataobjects.xml.Items;

@Ignore
public class CreateConfig {

	@Test
	public void testItemsFile() throws Exception{
		Items items = new Items();
		items.setActive(new Active());
		items.setInactive(new Inactive());
		engine.dataobjects.xml.MailItem item1 = new engine.dataobjects.xml.MailItem();
		item1.setHtmlTemplate("template");
		item1.setId(UUID.randomUUID().toString());
		item1.setName("name");
		items.getActive().getMailItem().add(item1 );
	
		JAXBContext context = JAXBContext.newInstance(Items.class);
		Marshaller marshaller = context.createMarshaller();
		marshaller.marshal(items, new File("src/test/testOutput.xml"));
		
		System.out.println("Done");
	}
}
